import { configureStore } from "@reduxjs/toolkit";
import systemSlice from "./systemSlice";
import userSlice from "./userSlice";

const store = configureStore({
  reducer: {
    system: systemSlice,
    user: userSlice,
  },
});

// 全局状态管理中的仓库的所有state的类型
export type RootState = ReturnType<typeof store.getState>;

// Inferred type: {posts: PostsState, comments: CommentsState, users: UsersState}
export type AppDispatch = typeof store.dispatch;

export default store;
